import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const state = {
  appConfig: {},
  code: ''
}

const mutations = {
  updateAppConfig (state, data) {
    this.state.appConfig.baseUrl = data.baseUrl
    this.state.appConfig.appName = data.appName
    this.state.appConfig.copyright = data.copyright
    this.state.appConfig.version = data.version
  },

  updateCode (state, code) {
    this.state.code = code
  }
}

export default new Vuex.Store({
  state,
  mutations
})
